package com.infinitus.multids.domain.primary;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

//@Entity
//@Table(name = "cmstop_content")
//@NamedQueries({
//		@NamedQuery(name = "ContentInfo.findAll", query = "SELECT e FROM ContentInfo e"),
//		@NamedQuery(name = "ContentInfo.distinct", query = "SELECT new ContentInfo(e.contentid, e.title) FROM ContentInfo e where e.modelid ='100' group by e.contentid, e.title ") })
public class ContentInfo implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -974188672838232154L;
	public static final String TITLE = "cmstop_content_title_";
	public static final String NAME = "cmstop_content_name_";
//	@Id
	private Integer contentid;
	private Integer catid;
	private Integer modelid;
	private String title;
	private String subtitle;
	private Integer sourceid;
	private Integer topicid;
	private String url;
	private Integer created;
	private Integer published;
	private Integer modified;
	private Integer pv;
	private Integer allowcomment;
	private Integer comments;
	
	private String name;
	public Integer getContentid() {
		return contentid;
	}
	public void setContentid(Integer contentid) {
		this.contentid = contentid;
	}
	public Integer getCatid() {
		return catid;
	}
	public void setCatid(Integer catid) {
		this.catid = catid;
	}
	public Integer getModelid() {
		return modelid;
	}
	public void setModelid(Integer modelid) {
		this.modelid = modelid;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getSubtitle() {
		return subtitle;
	}
	public void setSubtitle(String subtitle) {
		this.subtitle = subtitle;
	}
	public Integer getSourceid() {
		return sourceid;
	}
	public void setSourceid(Integer sourceid) {
		this.sourceid = sourceid;
	}
	public Integer getTopicid() {
		return topicid;
	}
	public void setTopicid(Integer topicid) {
		this.topicid = topicid;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public Integer getCreated() {
		return created;
	}
	public void setCreated(Integer created) {
		this.created = created;
	}
	public Integer getPublished() {
		return published;
	}
	public void setPublished(Integer published) {
		this.published = published;
	}
	public Integer getModified() {
		return modified;
	}
	public void setModified(Integer modified) {
		this.modified = modified;
	}
	public Integer getPv() {
		return pv;
	}
	public void setPv(Integer pv) {
		this.pv = pv;
	}
	public Integer getAllowcomment() {
		return allowcomment;
	}
	public void setAllowcomment(Integer allowcomment) {
		this.allowcomment = allowcomment;
	}
	public Integer getComments() {
		return comments;
	}
	public void setComments(Integer comments) {
		this.comments = comments;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((catid == null) ? 0 : catid.hashCode());
		result = prime * result
				+ ((contentid == null) ? 0 : contentid.hashCode());
		result = prime * result + ((title == null) ? 0 : title.hashCode());
		return result;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ContentInfo other = (ContentInfo) obj;
		if (catid == null) {
			if (other.catid != null)
				return false;
		} else if (!catid.equals(other.catid))
			return false;
		if (contentid == null) {
			if (other.contentid != null)
				return false;
		} else if (!contentid.equals(other.contentid))
			return false;
		if (title == null) {
			if (other.title != null)
				return false;
		} else if (!title.equals(other.title))
			return false;
		return true;
	}
	
	@Override
	public String toString() {
		return "ContentInfo [contentid=" + contentid + ", catid=" + catid
				+ ", modelid=" + modelid + ", title=" + title + ", subtitle="
				+ subtitle + ", sourceid=" + sourceid + ", topicid=" + topicid
				+ ", url=" + url + ", created=" + created + ", published="
				+ published + ", modified=" + modified + ", pv=" + pv
				+ ", allowcomment=" + allowcomment + ", comments=" + comments
				+ "]";
	}
	

}
